package com.jt.mapper;

import com.jt.pojo.User;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;
@Repository
//@Mapper
public interface UserMapper {
    List<User>findAll();

    @Select("select*from demo_user where id = #{id}")//查询
//    @Insert("")//增加
//    @Update("")//更新
//    @Delete("")//删除
    User findUserById(int id);
    @Insert("insert into demo_user(id,name,age,sex) value (null,#{name},#{age},#{sex})")
    void insert(User user);

    @Update("update demo_user set age=#{age},sex=#{sex} where name=#{name}")
    void updateByName(User user);



}
